package com.yohann.designPattern.prototype.clone;

/**
 * <p>
 * 克隆羊
 * </p>
 *
 * @author Yohann
 * @since 2021/2/2 15:16
 */
public class Sheep implements Cloneable {
    private String name;
    private String color;

    public Sheep(String name, String color) {
        this.name = name;
        this.color = color;
    }

    @Override
    public String toString() {
        return "Sheep{" +
                "name='" + name + '\'' +
                ", color='" + color + '\'' +
                '}';
    }

    /**
     * 实现Cloneable接口
     * 重写克隆方法
     */
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}